package com.repair.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.repair.entity.RepairTrack;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import java.time.LocalDateTime;
import java.util.List;

@Mapper
public interface RepairTrackMapper extends BaseMapper<RepairTrack> {
    
    /**
     * 查询维修工指定时间范围内的轨迹
     */
    @Select("SELECT * FROM repair_track " +
            "WHERE repairman_id = #{repairmanId} " +
            "AND create_time >= #{startTime} " +
            "AND create_time < #{endTime} " +
            "ORDER BY create_time ASC")
    List<RepairTrack> findByRepairmanIdAndTimeRange(
        @Param("repairmanId") Long repairmanId,
        @Param("startTime") LocalDateTime startTime,
        @Param("endTime") LocalDateTime endTime
    );
} 